<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> 
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<html:html>
<head>
	<LINK href="../styles/stylewang.css"  type=text/css rel=stylesheet>
	<LINK href="xtree.css"  type=text/css rel=stylesheet>
	<style type="text/css"></style>
</head>
<%String elementId = (String)request.getAttribute("ElementID");%>
<body>
<table border="0" width=100% >
	
</table>
<table border="0" cellspacing="0" cellpadding="0" id="table1" width=100% >

<tr id="table1" ><td id="onlybt"><bean:message key="shotrelation"/></td></tr>
<logic:iterate name="SGPS" id="element">
<logic:notEqual name="element" property="relation_flag" value="0">

<tr>
	<td width="100%" id="rightcenter">&nbsp;
		<logic:equal name="element" property="relation_flag" value="2">
			&nbsp;<bean:write name="element" property="shotGroupName"/>&nbsp;&nbsp;
			<logic:notEmpty name="Manage">
			<a href="./deles.do?ShotID=<bean:write name="element" property="shotGroupId"/>&ElementID=<bean:write name="ElementID" />" onclick="return   confirm('ConfirmDelete')">[<bean:message key="delete"/>]</a>
		</logic:notEmpty>
		</logic:equal>
		<logic:equal name="element" property="relation_flag" value="1">
			<font color=BBBBBB>&nbsp;<bean:write name="element" property="shotGroupName"/></font>&nbsp;&nbsp;
			<logic:notEmpty name="Manage">
			<a href="./deles.do?ShotID=<bean:write name="element" property="shotGroupId"/>&ElementID=<bean:write name="ElementID" />" onclick="return   confirm('ConfirmDelete')">[<bean:message key="delete"/>]</a>
		</logic:notEmpty>
		</logic:equal>		
	</td>
</tr>
</logic:notEqual>
</logic:iterate>

<logic:notEmpty name="Manage">
<tr><td id="rightbottom">
<bean:message key="RelateShotInShotgroup"/><form name="addesForm" method="post" action="addes.do">
<select name="sgpId" style="font-size: 11px">
	<logic:iterate id="element" name="SGPS">
		<logic:equal name="element" property="relation_flag" value="1">
			<option value='<bean:write name="element" property="shotGroupId"/>' style="color=BBBBBB"><bean:write name="element" property="shotGroupName"/></option>
		</logic:equal>
		<logic:equal name="element" property="relation_flag" value="0">
			<option value='<bean:write name="element" property="shotGroupId"/>'><bean:write name="element" property="shotGroupName"/></option>
		</logic:equal>
	</logic:iterate>
</select>&nbsp;&nbsp;<input style="font-size: 11px" type="button" onClick="submitAddesForm()" value="add"/>
<input type="hidden" name="elementId" value="<%=elementId%>">
</form>
</td></tr>
</logic:notEmpty>

</table>
</body>
</html:html>
<script language="javascript">
function submitAddesForm(){
	if(window.document.addesForm.sgpId.value==""){
		alert("No ShotGroup selected!");
	}
	window.document.addesForm.submit();
}

</script>
